package com.ruoyi.order.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.order.domain.SysOperLog1;
import com.ruoyi.order.service.ISysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test/operlog")
public class TestOperlogController extends BaseController
{
    @Autowired
    private ISysOperLogService operLogService;

    @GetMapping("/{method}")
    public AjaxResult operlog(@PathVariable("method") String method)
    {
        SysOperLog1 operLog = new SysOperLog1();
        operLog.setTitle("测试数据");
        operLog.setOperName("admin");
        operLog.setRequestMethod(method);
        return toAjax(operLogService.insertOperlog(operLog));
    }

    @GetMapping("/list")
    public AjaxResult list()
    {
        return AjaxResult.success(operLogService.selectOperLogList(new SysOperLog1()));
    }
}
